package com.ruoyi.hospital.service.member.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.member.MemberPointInfoMapper;
import com.ruoyi.hospital.domain.member.MemberPointInfo;
import com.ruoyi.hospital.service.member.IMemberPointInfoService;

/**
 * 积分记录Service业务层处理
 * 
 * @author wendao
 * @date 2024-08-16
 */
@Service
public class MemberPointInfoServiceImpl implements IMemberPointInfoService 
{
    @Autowired
    private MemberPointInfoMapper memberPointInfoMapper;

    /**
     * 查询积分记录
     * 
     * @param id 积分记录主键
     * @return 积分记录
     */
    @Override
    public MemberPointInfo selectMemberPointInfoById(Integer id)
    {
        return memberPointInfoMapper.selectMemberPointInfoById(id);
    }

    /**
     * 查询积分记录列表
     * 
     * @param memberPointInfo 积分记录
     * @return 积分记录
     */
    @Override
    public List<MemberPointInfo> selectMemberPointInfoList(MemberPointInfo memberPointInfo)
    {
        return memberPointInfoMapper.selectMemberPointInfoList(memberPointInfo);
    }

    /**
     * 新增积分记录
     * 
     * @param memberPointInfo 积分记录
     * @return 结果
     */
    @Override
    public int insertMemberPointInfo(MemberPointInfo memberPointInfo)
    {
        memberPointInfo.setCreateTime(DateUtils.getNowTimeSecond());
        return memberPointInfoMapper.insertMemberPointInfo(memberPointInfo);
    }

    /**
     * 修改积分记录
     * 
     * @param memberPointInfo 积分记录
     * @return 结果
     */
    @Override
    public int updateMemberPointInfo(MemberPointInfo memberPointInfo)
    {
        memberPointInfo.setUpdateTime(DateUtils.getNowTimeSecond());
        return memberPointInfoMapper.updateMemberPointInfo(memberPointInfo);
    }

    /**
     * 批量删除积分记录
     * 
     * @param ids 需要删除的积分记录主键
     * @return 结果
     */
    @Override
    public int deleteMemberPointInfoByIds(Integer[] ids)
    {
        return memberPointInfoMapper.deleteMemberPointInfoByIds(ids);
    }

    /**
     * 删除积分记录信息
     * 
     * @param id 积分记录主键
     * @return 结果
     */
    @Override
    public int deleteMemberPointInfoById(Integer id)
    {
        return memberPointInfoMapper.deleteMemberPointInfoById(id);
    }
}
